package ws.jdbc.concurrent.driver.sqlserver.tds


/**
 * Test the execution of SQL command on several situations.
 *
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public class TDSMessageBatchTest extends GroovyTestCase {

  TDSMessage message;
  
  void setUp() throws IOException {
    message = new TDSMessage(new Socket(serverName, port));
    message.login("", userName, password, serverName, "JDBCDriverTests");
  }

  /**
   * Test of executeSQLBatch method, of class TDSMessage.
   */
  void SQLBatch1() {
    println "testSQLBatch1()"
    
    message.executeSQLBatch("Select 'foo' as 'bar'");
  }

  /**
   * Test of executeSQLBatch method, of class TDSMessage.
   */
  void testSQLBatch2() {
    println "testSQLBatch2()"
    
    println message.executeSQLBatch("Select * from Table1")
  }

  /**
   * Test of executeSQLBatch method, of class TDSMessage.
   */
  void SQLBatch3() {
    println "testSQLBatch3()"

    println message.executeSQLBatch("Select count(*) from Table1")
  }
}